package com.example.swordjava;


public class Test27 {

    public static void main(String[] args) {

        int[] a = {2, 3, 1, 0, 2, 5, 3};
    }

    class TreeNode {
        TreeNode left = null;
        TreeNode right = null;
        int val;

        public TreeNode(int val) {
            this.val = val;
        }
    }

    /**
     * 操作给定的二叉树，将其变换为源二叉树的镜像。
     */

    public Test28.TreeNode Mirror(Test28.TreeNode pRoot) {
        // write code here
        if (pRoot == null) return null;
        Test28.TreeNode temp = pRoot.left;
        pRoot.left = pRoot.right;
        pRoot.right = temp;
        if (pRoot.left != null) {
            Mirror(pRoot.left);
        }
        if (pRoot.right != null) {
            Mirror(pRoot.right);
        }
        return pRoot;
    }


}
